/*******************************************************************************
 * Copyright (c) 2023. 山东新北洋信息技术股份有限公司 保留所有权利。
 *
 ******************************************************************************/

package online.xuping.thousandsOfWorlds.demo.constant.errorcode;

import online.xuping.thousandsOfWorlds.common.constants.CommonErrorCodeHelper;
import online.xuping.thousandsOfWorlds.common.constants.ErrorTypeCodeEnum;
import online.xuping.thousandsOfWorlds.common.constants.ModelCodeEnum;
import online.xuping.thousandsOfWorlds.common.constants.WarehouseBusinessCodeEnum;

public enum ProjectErrorCodeEnum implements CommonErrorCodeHelper {
    //该一级项目已存在
    FIRST_PROJECT_DUPLICATE("该一级项目已存在", "01", ErrorTypeCodeEnum.PARAM_ERROR),
    SECOND_PROJECT_DUPLICATE("该二级项目已存在", "02", ErrorTypeCodeEnum.PARAM_ERROR),
    PARAM("参数错误", "01", ErrorTypeCodeEnum.PARAM_ERROR),
    ;

    /**
     * 错误码
     */
    private final String code;
    /**
     * 错误信息
     */
    private final String msg;

    /**
     * 构造方法
     *
     * @param msg               错误信息
     * @param code              code
     * @param errorTypeCodeEnum 类型枚举
     */
    ProjectErrorCodeEnum(String msg, String code, ErrorTypeCodeEnum errorTypeCodeEnum) {
        this.code = ModelCodeEnum.WAREHOUSE.getCode() + errorTypeCodeEnum.getCode() +
                WarehouseBusinessCodeEnum.OTHER.getCode() + code;
        this.msg = msg;
    }

    @Override
    public String getCode() {
        return code;
    }

    @Override
    public String getMsg() {
        return msg;
    }
}
